#ifndef RTMPRECEIVE_H
#define RTMPRECEIVE_H
#include "define.h"
#include "XReceiveVideo.h"


class IReceiveEvent
{
public:
    virtual void OnReceiveVideo(QImage image) = 0;
};

class RtmpReceive:public QThread, IReceiveVideoEvent
{
public:
    RtmpReceive();
    ~RtmpReceive();
    void StopAll();
    void SetObserver(IReceiveEvent * ob){mEvent = ob;}
    void OnReceives(QImage image) override;
    void SetRtmpUrl(string url){ mRtmpUrl = url;}

protected:
   void run() override;

private:
   QImage matToqimage(const cv::Mat& mat);

private:
   IReceiveEvent* mEvent;
   XReceiveVideo *mXV;
   bool isExit;
   string mRtmpUrl;

};

#endif // RTMPRECEIVE_H
